/**
 * v-partialDisplay 部分展示
 * Copyright (c) 2024 RenYongQiang
 */
export default {
  bind(element, binding) {
    let value = binding.value;
    element.style.position = 'relative';
    element.style.height = (value && value.height) ? value.height + 'px' : '100px';
    element.style.overflow = 'hidden';
    const divEl = document.createElement('div');
    divEl.style = `
      width: 100%;
      background-image: linear-gradient(${(value && value.start) ? value.start : 'rgba(255, 255, 255, 0.5)'}, ${(value && value.end) ? value.end : 'rgba(255, 255, 255, 1)'});
      height: ${(value && value.height) ? value.height/2 : 50}px;
      position: absolute;
      left: 0;
      bottom: 0;
      z-index: 9;
   `;
    element.appendChild(divEl);
  }
}
